﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

//时间 
namespace help
{
    class TimerHelp
    {
        public static TimeSpan LocalUtcOffset { get; private set; }

        static TimerHelp()
        {
            LocalUtcOffset = TimeZone.CurrentTimeZone.GetUtcOffset(DateTime.Now);
        }

        public static DateTime Now
        {
            get
            {
                return ToLocalTime(DateTime.UtcNow);
            }
        }

        public static DateTime ToLocalTime(DateTime dateTime)
        {
            return dateTime + LocalUtcOffset;
        }
    }
}
